package cn.com.dcsgo.controller;

import cn.com.dcsgo.dto.MemberUpdateDTO;
import cn.com.dcsgo.model.Result;
import cn.com.dcsgo.service.MemberService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 小程序端会员相关接口
 *
 * @author Dcsgo
 * @since 2025/10/30 16:04
 */
@Tag(name = "小程序端会员相关接口")
@RestController
@RequestMapping("p/user")
public class MiniAppMemberController {
    @Resource
    private MemberService memberService;

    @PutMapping("setUserInfo")
    @Operation(summary = "更新会员信息", description = "更新当前登录会员的个人信息，可更新用户昵称和头像")
    public Result<Void> updateMember(@RequestBody MemberUpdateDTO memberUpdateDTO) {
        return Result.handle(memberService.update(memberUpdateDTO));
    }
}
